#include <stdio.h>
#include <string.h>
#include "hme_includes.h"
#include "hme_retarget.h"

int main(void)
{
	HME_UART_InitTypeDef init;
	HME_UART_StructInit(&init);
	HME_UART_Init(DEMO_UART, &init);

	printf("Hello MCU Fuction ...%s %s\r\n", __DATE__, __TIME__);
		
	/************************************** uart function *******************************/
	//uart_echo_task();
	//uart_RXInt_task();
	//uart_TXInt_task();
	uart_DMARX_task();
	//uart_DMATX_task();
	
	/************************************** gpio function *******************************/
	//gpio_toggle_task();
	//gpio_bitband_task();
	//gpio_interrupt_task();
	
	/************************************** dma function *******************************/
	//DMA_Mem_to_Mem();
	
	/************************************** spi function *******************************/
	#if SPI_MASTER_MODE
	//Flash_PageWr_SPISingle_withDMA();
	//Flash_PageRd_SPISingle_withDMA();
	//Spiflash_Single_Task();	
	//Spiflash_Single_INT_Task();
	//Spiflash_Single_DMA_Task();
	//Spiflash_Quad_Task();
	//Spiflash_Quad_DMA_Task();
	
	#elif SPI_SLAVE_MODE
	spi_slave_transfer();
	#endif
	
	/************************************** i2c function *******************************/
	#if I2C_MASTER_MODE
	//I2C_Master_Wr_Rd_EEPROM_AT24C256_task();
	//I2C_Master_Wr_Rd_EEPROM_AT24C256_ByDMA_task();
	//I2C_Master_Wr_Rd_EEPROM_AT24C256_Interrupt_task();
	#elif I2C_SLAVE_MODE
	//I2C_Slave_Mode_Recieve_task();
	//I2C_Slave_Mode_Feedback_Interrupt_task();
	#endif

	/************************************** isp function *******************************/
	#if UART_IRQ_FOR_ISP
	ISP_task();
	#endif

	/************************************** timer function *****************************/
	//timer_task();
	
	/************************************** wdt function *******************************/
	//wdt_interrupt_task();
	//wdt_reset_task();
	
	/************************************** sleep function *****************************/
	//sleep_wakeup_by_GpioInt_task();
	//sleep_wakeup_by_SystickInt_task();
	
	/************************************** external fpga interrupt function ***********/
	//ex_intr_task();
	
	while(1){};
}
